package MyTread;

import java.util.Comparator;
import java.util.PriorityQueue;

class MyThread extends Thread {

    @Override
    public void run() {
        while(true) {
            System.out.println("Hello MyThread");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

public class Main {

    public static void main(String[] args) {

        Thread thread = new MyThread();
        thread.start();
        while(true) {
            System.out.println("Hello Main");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
